package com.tofch.biproject.controller;


import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor;

@RestController
@Profile({"dev","local"})
public class QueueController {

    @Resource
    private ThreadPoolExecutor threadPoolExecutor;
    @GetMapping("/test")
    public void gg(){

        CompletableFuture.runAsync(()->{
            String s = "异步调用成功";
            System.out.println(s);

        },threadPoolExecutor);

    }

}
